from django.db import models

class Attractions(models.Model):
    city_name = models.CharField(max_length=255, null=True, blank=True, verbose_name='城市名称')
    businessId = models.CharField(max_length=255, null=True, blank=True, verbose_name='业务ID')
    zone_name = models.CharField(max_length=255, null=True, blank=True, verbose_name='区域/商圈名称')
    poi_name = models.CharField(max_length=255, null=True, blank=True, verbose_name='景点名称')
    comment_score = models.FloatField(null=True, blank=True, verbose_name='用户评分(0-5分)')
    sight_level = models.CharField(max_length=255, null=True, blank=True, verbose_name='景点等级')
    cover_image_url = models.URLField(max_length=1024, null=True, blank=True, verbose_name='封面图片URL')
    tag_name_list = models.JSONField(null=True, blank=True, verbose_name='标签列表')
    market_price = models.DecimalField(max_digits=10, decimal_places=2, null=True, blank=True, verbose_name='市场价(元)')
    is_free = models.BooleanField(null=True, blank=True, verbose_name='是否免费')
    short_features = models.TextField(null=True, blank=True, verbose_name='简短特色描述')
    sight_category_info = models.JSONField(null=True, blank=True, verbose_name='景点分类信息')
    latitude = models.FloatField(null=True, blank=True, verbose_name='纬度')
    longitude = models.FloatField(null=True, blank=True, verbose_name='经度')
    heat_score = models.IntegerField(null=True, blank=True, verbose_name='热度评分(0-100)')
    address = models.TextField(null=True, blank=True, verbose_name='详细地址')
    phone = models.CharField(max_length=255, null=True, blank=True, verbose_name='联系电话')
    opening_hours = models.TextField(null=True, blank=True, verbose_name='开放时间')
    introduce = models.TextField(null=True, blank=True, verbose_name='详细介绍')
    preferential_policies_list = models.JSONField(null=True, blank=True, verbose_name='优惠政策')
    service_facility_list = models.JSONField(null=True, blank=True, verbose_name='服务设施')
    created_at = models.DateTimeField(auto_now_add=True, verbose_name='创建时间')

    class Meta:
        verbose_name = '景点信息'
        verbose_name_plural = '景点信息'
        ordering = ['-created_at']

    def __str__(self):
        return self.poi_name or '未命名景点'